package com.moon.admin.sys.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moon.admin.sys.entity.SysDeptEntity;

/**
 * 部门管理 数据层
 * 
 * @author ninglong
 */
@Mapper
public interface SysDeptMapper extends BaseMapper<SysDeptEntity>{
	
	/**
	 * 根据id获取所有子id
	 */
	@Select("select * from sys_dept d where find_in_set(#{id},d.grandParentIds)>0 and d.status=0")
	List<SysDeptEntity> getDeptAllChildrenIdById(@Param("id")Integer id);
}
